<template>
  <div>
      <nva-bar class="nav-bar">
          <div slot="center">购物车({{cartLength}})</div>
      </nva-bar>


  </div>
</template>

<script>
import NvaBar from '@/components/common/nvabar/NvaBar.vue'
import { mapGetters } from 'vuex' 
export default {
    name:"CartNvaBar",
    components:{
        NvaBar
    },
    computed:{
        // 映射计算属性
        ...mapGetters(['cartLength','cartList'])
    }
}
</script>

<style scoped>
.nav-bar{
    background-color: chocolate;
    position: fixed;
    left: 0;
    right: 0;
    top: 0px;
}
</style>